package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.dto.CmservicesDto;
import com.dingreading.cloud.admin.entity.Cmservices;
import com.mybatisflex.core.service.IService;

import java.util.List;
import java.util.Map;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface CmservicesService extends IService<Cmservices> {

    List<CmservicesDto> dtoListByOrderCode(String storeUid, String memberUid, String orderCode);

    List<CmservicesDto> dtoListByOrderCodes(String storeUid, List<String> orderCodes);

    // 按订单创建时间升序且赠送升序查可消耗的服务
    Cmservices getMemberConsumesService(List<String> storeUidList, String memberUid, String projectUid);

    boolean haveProjectUid(String projectUid);

    boolean haveProductUid(String productUid);

    // 获取已到期的会员服务
    List<Cmservices> overdueListByCorpUidAndStatusAndEndDate(String corpUid, String beginDate, String endDate);

    // 查询会员有效服务数量，开卡未到期、未开卡、暂停服务的总数量
    Map<String, List<Cmservices>> validNumMap(String corpUid, String endDate, List<String> memberUids);

    List<CmservicesDto> dtoListByOrderCodesNotChangeOrRefund(String storeUid, List<String> orderCodes);

    // 获取未到期的服务
    List<Cmservices> listByStoreUidInAndEndDateAndLeftLesson(List<String> storeUidList, String today);

    List<Cmservices> overdueMemberList(List<String> storeUidList, String beginDate, String endDate);

    List<Cmservices> amountSplitList(List<String> storeUidList, String beginDate, String endDate);

    List<Cmservices> listByOrderCodeAndType(String orderCode, boolean editOrder);

    // 更新服务的服务总金额和单课次金额
    void updateAmount(String uid, double totalAmount, double unitAmount);

    /*双思学科修改*/
    List<Cmservices> listByMainSubjectUid(String mainSubjectUid);

    void updateSubject(String uid, String subjectUid, String subjectName, String stageUid, String stageName);
}
